package com.chinasoft.mall.activity;

import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chinasoft.mall.R;
import com.chinasoft.mall.framework.Config;
import com.chinasoft.mall.model.response.EpgBean;

public class WidgetActivity extends BaseActivity {
	private TextView ts_content;
	// private Button ensure;
	private LinearLayout box_ll;
	
	private ImageView message_close;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.showplaying);
		ts_content = (TextView) findViewById(R.id.ts_content);
		message_close = (ImageView) findViewById(R.id.message_close);
		box_ll = (LinearLayout) findViewById(R.id.box_ll);
		// ensure=(Button) findViewById(R.id.ensure);
		box_ll.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				//doNothing
			}
		});
		EpgBean _eb = ((EpgBean) getIntent().getSerializableExtra(
				Config.INTENT_OBJ));
		if (_eb.getTHUM() != null) {
			ts_content.setText(_eb.getTHUM());
		} else {
			if (_eb.getBiType() == 0) {
				ts_content.setText(_eb.getGOODS_NAME() + "正在直播，请关注");
			} else if (_eb.getBiType() == 1) {
				ts_content.setText(_eb.getGOODS_NAME());
			}
		}
		
		message_close.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				WidgetActivity.this.finish();
			}
		});
//		box_ll.setOnClickListener(new OnClickListener() {
//			@Override
//			public void onClick(View v) {
//				WidgetActivity.this.finish();
//			}
//		});
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		WidgetActivity.this.finish();
		return false;
	}

	@Override
	protected void onStop() {
		super.onStop();
		WidgetActivity.this.finish();
	}

	@Override
	public void onBackPressed() {
		super.onBackPressed();
		WidgetActivity.this.finish();
	}
}
